package com.bys.eunm;


import java.util.Arrays;


/**
 * 代码生成的场景枚举
 *
 */
public enum CodegenSceneEnum {

    ADMIN(1, "管理后台", "admin", ""),
    APP(2, "用户 APP", "app", "App");

    /**
     * 场景
     */
    private final Integer scene;
    /**
     * 场景名
     */
    private final String name;
    /**
     * 基础包名
     */
    private final String basePackage;
    /**
     * Controller 和 VO 类的前缀
     */
    private final String prefixClass;

    public static CodegenSceneEnum valueOf(Integer scene) {
        return Arrays.stream(values()).filter( sc -> sc.getScene().equals(scene)).findFirst().orElse(null);
    }

    public Integer getScene() {
        return scene;
    }

    public String getName() {
        return name;
    }

    public String getBasePackage() {
        return basePackage;
    }

    public String getPrefixClass() {
        return prefixClass;
    }

    CodegenSceneEnum(Integer scene, String name, String basePackage, String prefixClass) {
        this.scene = scene;
        this.name = name;
        this.basePackage = basePackage;
        this.prefixClass = prefixClass;
    }
}
